﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index1.aspx.cs" Inherits="AnyOffice.general.news.manage.index1" %>
<%@Register TagPrefix="Webdiver" Namespace="Webdiver" Assembly="AspnetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script>
function open_news(news_id)
{
// URL="read_news.aspx?news_id="+news_id;
// myleft=(screen.availWidth-500)/2;
// mytop=150
// mywidth=600;
// myheight=500;
// window.open(URL,"read_news","height="+myheight+",width="+mywidth+",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");


 var mwidth = "600";
 var mheight = "450";
 var loc_x = parseInt((window.screen.width - mwidth) / 2);
 var loc_y = parseInt((window.screen.height - mwidth) / 2);

 var _oParameter = new Object();
 _oParameter.dialogTitle = "简报查看";
 _oParameter.openFile = "read_news.aspx?news_id=" + news_id + "&num=" + Math.random();

 window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  


}

function delete_news(news_id,page)
{
    msg = '确认要删除该项简报么？';
 if(window.confirm(msg))
 {
  URL="delete.aspx?news_id=" + news_id + "&page=" + page;
  window.location=URL;
 }
}

function change_type(type_id)
{
 window.location="index1.aspx?type_id="+type_id;
}

function re_news(news_id)
{
// URL="re_news.aspx?news_id="+news_id;
// myleft=(screen.availWidth-500)/2;
// window.open(URL,"read_news","height=500,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=100,left="+myleft+",resizable=yes");


 var mwidth = "600";
 var mheight = "450";
 var loc_x = parseInt((window.screen.width - mwidth) / 2);
 var loc_y = parseInt((window.screen.height - mwidth) / 2);

 var _oParameter = new Object();
 _oParameter.dialogTitle = "简报查看";
 _oParameter.openFile = "re_news.aspx?news_id=" + news_id + "&num=" + Math.random();

 window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
   

}
</script>
	</HEAD>
	<body class="bodycolor" style="padding-top:0;" topmargin="5">
		<form id="Form1" method="post" runat="server">
          <div class="main_div">
			<table class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
				<tr>
					<td class="Big" width="40%"><img src="/images/notify_open.gif" align="absMiddle"><span class="big3">
							管理简报</span>
							<SELECT id="ddlTypeId" name="ddlTypeId" runat="server" DataTextField="TypeName" DataValueField="TypeId" class="BigSelect">
					</SELECT>
					</td>
					<td width="20%">
						<asp:Literal id="litNavCount" runat="server"></asp:Literal>
					</td>
					<td width="40%">						
						<asp:Literal id="litNavPager" runat="server"></asp:Literal>
					</td>
				</tr>
			</table>			
			<asp:panel id="pnlMain" runat="server">
			<BR>
				<asp:Repeater id="rptNews" runat="server">
					<HeaderTemplate>
						<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3">
							<tr class="TableHeader">
								<td nowrap align="center">标题</td>
								<TD noWrap align="center">类型</TD>
								<TD noWrap align="center">发送范围</TD>									
								<td nowrap align="center">发布人</td>
								<td nowrap align="center">发布时间</td>								
								<td nowrap align="center">操作</td>
							</tr>
					</HeaderTemplate>
					<ItemTemplate>
						<tr class="TableLine1">
							<td nowrap>
								<a href="javascript:open_news('<%#Eval("NewsId")%>');"><%#Eval("Subject")%></a>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
								<td>
									<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
								</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("UserName")%></u></td>
							<td nowrap align="center"><%#Eval("SendTime")%></td>							
							<td nowrap align="center">
								<a href="edit.aspx?news_id=<%#Eval("NewsId")%>&type_id=<%=ViewState["TypeId"]%>&page=<%=ViewState["CurrentPage"]%>">修改</a> <a href="javascript:delete_news('<%#Eval("NewsId")%>','<%=ViewState["CurrentPage"]%>');">
									删除</a> <a href="javascript:re_news('<%#Eval("NewsId")%>');">管理评论</a>
							</td>
						</tr>
					</ItemTemplate>
					<AlternatingItemTemplate>
					<tr class="TableLine2">
							<td>
								<a href="javascript:open_news('<%#Eval("NewsId")%>');"><%#Eval("Subject")%></a>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
								<td>
									<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
								</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="cursor:hand"><%#Eval("UserName")%></u></td>
							<td nowrap align="center"><%#Eval("SendTime")%></td>							
							<td nowrap align="center">
								<a href="edit.aspx?news_id=<%#Eval("NewsId")%>&type_id=<%=ViewState["TypeId"]%>&page=<%=ViewState["CurrentPage"]%>">修改</a> <a href="javascript:delete_news('<%#Eval("NewsId")%>','<%=ViewState["CurrentPage"]%>');">
									删除</a> <a href="javascript:re_news('<%#Eval("NewsId")%>');">管理评论</a>
							</td>
						</tr>
					</AlternatingItemTemplate>
					<FooterTemplate>
						</table>
					</FooterTemplate>
				</asp:Repeater>
				<TABLE width="100%" border="0">
					<TR>
						<TD>
							<Webdiver:AspNetPager id="AspNetPager1" runat="server" AlwaysShow="True" PageSize="10" DisabledButtonImageNameExtension="g"
								CpiButtonImageNameExtension="r" ButtonImageNameExtension="n" ImagePath="../images" PagingButtonSpacing="0"
								CustomInfoSectionWidth="35%" UrlPaging="True" NumericButtonTextFormatString="[{0}]" SubmitButtonText="转到"
								ShowInputBox="Always" ShowCustomInfoSection="left" HorizontalAlign="Right" OnPageChanged="ChangePage"
								Font-Size="10pt" SubmitButtonClass="SmallButton" InputBoxClass="SmallInput" CssClass="small1"></Webdiver:AspNetPager></TD>
					</TR>
				</TABLE>
			</asp:panel>
			<asp:literal id="litMessage" runat="server"></asp:literal>
            </div>
		</form>
	</body>
</HTML>
